import request from '@/utils/request'
import defaultSettings from '@/settings'

export function fetchList(query) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/sysRole/list',
    method: 'post',
    data: query
  })
}

export function save(data) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/sysRole/save',
    method: 'post',
    data: data
  })
}
export function removeById(id) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/sysRole/removeByIds?id=' + id,
    method: 'get'
  })
}

//角色下拉列表
export function getList() {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/sysRole/getList',
    method: 'get'
  })
}


export function getMenuPermissionsById(id) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/sysRole/getMenuPermissionsById?id='+id,
    method: 'get'
  })
}

export function saveMenuPermission(id,menuIds) {
  return request({
    url: defaultSettings.serviceUrl.moon_fast + '/sysRole/saveMenuPermission?id='+id +'&menuIds='+menuIds,
    method: 'get'
  })
}


